home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1993 September / clonecd / September 93.img / Archives / Fun, Tricks & Hacks / Hacks & Tricks - CARE / HotShift / HotShift.c < prev    next >
C/C++ Source or Header  |  1991-09-01  |  877b  |  39 lines

  1. pascal void main(void);
  2.  
  3.  
  4. pascal void main(void)
  5. {
  6.     Ptr        addr;
  7.     Ptr        globalP;
  8.     long    rD0;
  9.     EventRecord    *rA1;
  10.     
  11.     asm {
  12.         MOVEM.L    A2-A5/D1-D7, -(A7)            /* Save the non-volitle registers         */
  13.         MOVE.L    d0, rD0                        /* Get to d0 & a0 easily */
  14.         MOVE.L    a1, rA1
  15.     }
  16.         
  17.     addr = *(Ptr *)(((Ptr)&main) - 8);        /* Get the address of last filter     */
  18.     globalP = *(Ptr *)(((Ptr)&main) - 4);    /* Get the address of global storage     */
  19.                                             /* The structure is:
  20.                                                     long    last filter address;
  21.                                                     Ptr        globalDataSpace;        */
  22.  
  23. //    if ((rA1->what == mouseDown) || (rA1->what == mouseUp) || (rA1->what == nullEvent))
  24. //    {
  25. //        DebugStr("\PAdjusting cursor");
  26.         rA1->where.h -= 32;
  27.         rA1->where.v -= 32;
  28. //    }
  29.     
  30.         
  31.     asm {
  32.             MOVEM.L        (A7)+, A2-A5/D1-D7    /* Restore the non-volitle registers    */
  33.             MOVE.L        rD0, d0
  34.             MOVE.L        rA1, a1
  35.             MOVE.L        addr, A0
  36.             UNLK        A6
  37.             JMP            (A0)        
  38.     };
  39. }